﻿<my:CallingUserControl
	x:Class="Coding4Fun.FakeCall.Controls.LockControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:my="clr-namespace:Coding4Fun.FakeCall.Controls" 
	xmlns:Converters="clr-namespace:Coding4Fun.FakeCall.Converters" mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="White"
    d:DesignHeight="800" d:DesignWidth="480"
    Background="{StaticResource TransparentBrush}">
    <UserControl.Resources>
		<Converters:ImageConverter x:Key="ImageConverter" />
		<Converters:TimeConverter x:Key="getTimeConverter" />
		<Converters:FullTimeConverter x:Key="getFullTimeConverter" />
		<Converters:DayOfWeekConverter x:Key="getDayOfWeekConverter" />
		<Converters:DateConverter x:Key="getDateConverter" />
    </UserControl.Resources>
	<Grid>
		
		<Grid x:Name="lockScreen" Background="Black"
		  ManipulationCompleted="lock_ManipulationCompleted" 
		  ManipulationDelta="lock_ManipulationDelta">
			<Grid.Resources>
				<Storyboard x:Name="CoastGrid">
					<DoubleAnimationUsingKeyFrames 
						Storyboard.TargetName="gridTranslate" 
						Storyboard.TargetProperty="Y">
						<EasingDoubleKeyFrame x:Name="coastY" 
									KeyTime="00:00:01" Value="0">
                        
						</EasingDoubleKeyFrame>
					</DoubleAnimationUsingKeyFrames>
				</Storyboard>
			</Grid.Resources>
			<Grid.RenderTransform>
				<TranslateTransform x:Name="gridTranslate"/>
			</Grid.RenderTransform>
			<Image 
				Source="{Binding Settings.LockScreenPhoto, Converter={StaticResource ImageConverter}}" 
				Stretch="None" />
			<StackPanel VerticalAlignment="Bottom" Margin="30">
				<StackPanel>
					<TextBlock
							FontFamily="{StaticResource PhoneFontFamilyLight}" 
							FontSize="{StaticResource PhoneFontSizeExtraExtraLarge}" 
						Text="{Binding Path=Settings.LockScreenTime, Converter={StaticResource getTimeConverter}}" />
					<TextBlock
							Margin="0,-20"
							FontFamily="{StaticResource PhoneFontFamilyLight}" 
							FontSize="{StaticResource PhoneFontSizeExtraExtraLarge}"
						Text="{Binding Path=Settings.LockScreenDate, Converter={StaticResource getDayOfWeekConverter}}" />
					<TextBlock
							FontFamily="{StaticResource PhoneFontFamilyLight}" 
							FontSize="{StaticResource PhoneFontSizeExtraExtraLarge}"
						Text="{Binding Path=Settings.LockScreenDate, Converter={StaticResource getDateConverter}}" />
				</StackPanel>
				<StackPanel>
					<TextBlock
						Text="{Binding Settings.AppointmentName}"
						FontSize="{StaticResource PhoneFontSizeMediumLarge}"/>
					<TextBlock 
						Margin="0,-5"    
						Text="{Binding Settings.AppointmentLocation}"
						FontSize="{StaticResource PhoneFontSizeMediumLarge}" />
					<StackPanel Orientation="Horizontal">
						<TextBlock 
							FontSize="{StaticResource PhoneFontSizeMediumLarge}" 
							Text="{Binding Path=Settings.AppointmentStartTime, Converter={StaticResource getFullTimeConverter}}" />
						<TextBlock
							Margin="5, 0"
							Text=" -"
							FontSize="{StaticResource PhoneFontSizeMediumLarge}" />
						<TextBlock
							FontSize="{StaticResource PhoneFontSizeMediumLarge}" 
							Text="{Binding Path=Settings.AppointmentEndTime, Converter={StaticResource getFullTimeConverter}}" />
					</StackPanel>

				</StackPanel>
			</StackPanel>
		</Grid>
		<my:PhoneInfo VerticalAlignment="Top" ForceLightTheme="True" ShowTime="False" />
	</Grid>
</my:CallingUserControl>